<?php
namespace app\route;
use think\Route;
use think\Config;
use think\DB;
use think\Request;
$taglib_pre_load = config('template')['taglib_pre_load'];
$taglib_pre_load = $taglib_pre_load . ',app\\tag\\Tag';
$template = config('template');
$template['taglib_pre_load'] = $taglib_pre_load;
config('template',$template);
$tag = config('settingInfo')['tagModelUrl'];
if (!strpos($request->url(),'Api')) {
    Route::rule(['/' . $tag . '/:id/index_<page>' => ['tag/TagDetail/index',['ext'=>'html'],['page'=>'[a-zA-Z0-9_-]+']]]);
    Route::rule(['/' . $tag . '/index_<page>' => ['tag/Tag/index',['ext'=>'html'],['page'=>'[a-zA-Z0-9_-]+']]]);
    Route::rule(['/' . $tag . '/:name' => ['tag/Tag/index',['ext'=>'html'],['name'=>'[a-zA-Z0-9_-]+'],[]]]);
    Route::rule(['/' . $tag . '/:id' => ['tag/TagDetail/index',[],[]]]);
    Route::rule('/' . $tag . '/','tag/Tag/index');
}
if (strpos($request->url(),'Api') !== false) {
    Route::rule('/tag/:ctr/:act' ,'tag/:ctr/:act'); 
}
